from django import template


# 声明一个模板对象,也称为过滤器
register = template.Library()

# 声明并定义过滤器
@register.filter
def myreplace(value,args):
    oldValue = args.split(":")[0]
    newValue = args.split(":")[1]
    print("args:",args,type(args))
    print("oldValue",oldValue)
    print("newValue",newValue)
    print("value",value)
    return value.replace(oldValue,newValue)


